using MultiAgentsShared;

namespace MultiAgentsClient.ChatDataStructures;

public enum SubscriptionClass
{
    None = 0,
    GitlabPullRequest = 1,
}

public class WorkflowNotification : SerializableObjectBase
{
    public int id = 0;
    public string workflowName = "";
    public int workflowId = 0;
    public Dictionary<string, string> content = [];
    public string repositoryAddressUserSubscribed = "";
    public bool isProcessed = false;
    public bool requireApproval = true;
    public SubscriptionClass subscriptionClass = SubscriptionClass.None;

    public WorkflowNotification() { }

#if FRONTEND
    public WorkflowNotificationDisp ToDisp(string? countdown)
    {
        WorkflowNotificationDisp notificationDisp;
        if (countdown != null)
        {
            notificationDisp = new(id, $"A {subscriptionClass} trigger from {repositoryAddressUserSubscribed}.", workflowName + " Workflow", " in " + countdown + "s");
        }
        else
        {
            notificationDisp = new(id, $"A {subscriptionClass} trigger from {repositoryAddressUserSubscribed}.", workflowName + " Workflow", "");
        }
        return notificationDisp;
    }
#endif
}
